package com.example.springboot.web;

import com.example.springboot.bean.Adve;
import com.example.springboot.biz.AdveBiz;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

import javax.annotation.Resource;

@RestController
public class AdveAction {

    @Resource
    AdveBiz ab;

    @GetMapping("toAdve")
    public ModelAndView toAdve(int id, ModelAndView mav){
        Adve a = ab.queryNumsAdve(id);
        mav.setViewName("redirect:http://"+a.getUrl());
        return mav;
    }

}
